import { request } from 'umi';

/** 获取批次号 */
export async function getBatchNo() {
  return request(`/api/common/jrn`, {
    method: 'GET'
  });
}

/** 查询城市列表 */
export async function getCityList(data: {
  current: number;
  pageSize: number;
}) {
  return request(`/api/common/city/${data.current}/limit/${data.pageSize}`, {
    method: 'GET'
  });
}


/** 查询物流公司列表 */
export async function getLogisticsList() {
  return request(`/api/common/materiel/code`, {
    method: 'GET'
  });
}

// 获取当前用户是否可打折扣
export async function getCanDiscount() {
  return request(`/api/bui/oper/discount`, {
    method: 'GET'
  });
}


// 获取客户生成的唯一id
export async function getLoginUuid() {
  return request(`/api/common/ca/login/uuid`);
}

// 获取授权状态
export async function getSqStatus() {
  return request(`/api/common/ca/status`);
}

// 非文案签署接口
export async function signCa(params) {
  return request(`/api/common/ca/sign`, {
    method: 'POST',
    data: {
      ...params
    },
  });
}
// 查询CA开启状态
export async function getCaOpenStatus(module: string) {
  return request(`/api/common/ca/open?module=${module}`);
}


// Pad扫码登录-获取二维码
export async function getPadQrCode() {
  return request(`/api/common/ca/getAppScanLoginprepare`);
}

// Pad扫码登录-获取登录状态
export async function getQrCodeLoginStatus(token: string) {
  return request(`/api/common/ca/appScanLoginStatus`, {
    params: { token }
  });
}
